package org.example.mallchat.adapter;

import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutTextMessage;

/**
 * @author: zzh
 * @date: 2024/12/18 18:24:17
 * @version: 1.0
 */
// 适配器，转成Wx的消息类型
public class TextBuilder {
    public static WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage,
                                          WxMpService service) {
        WxMpXmlOutTextMessage wxMpXmlOutTextMessage = WxMpXmlOutMessage.TEXT().content(content)
                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
                .build();
        return wxMpXmlOutTextMessage;
    }
}
